package org.seedltd.upms.model.sys.form;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.seedltd.core.validation.Save;
import org.seedltd.core.validation.Update;
import org.seedltd.upms.enums.EnableStatus;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 菜单管理表单
 *
 * @author laizuan
 * @version 1.0
 * @since 2021/07/19
 */
@Getter
@Setter
public class SysMenuForm {

    /**
     * 菜单主键
     */
    @NotNull(message = "菜单主键不能为空", groups = {Update.class})
    private Long menuId;

    /**
     * 菜单名称
     */
    @Length(message = "菜单名称长度不能超过50个字符", max = 50, groups = {Save.class, Update.class})
    @NotBlank(message = "菜单名称不能为空", groups = {Save.class, Update.class})
    private String menuName;

    /**
     * 父级菜单主键
     */
    private Long parentId;

    /**
     * 国际化菜单key
     */
    @Length(message = "国际化菜单key长度不能超过100个字符", max = 100, groups = {Save.class, Update.class})
    private String i18n;

    /**
     * 菜单类型（1目录，2菜单，3按钮）
     */
    @NotNull(message = "菜单类型不能为空", groups = {Save.class, Update.class})
    private Integer menuType;

    /**
     * 图标
     */
    @Length(message = "图标长度不能超过32个字符", max = 32, groups = {Save.class, Update.class})
    private String icon;

    /**
     * 路由不缓存（0,缓存，1不缓存）
     */
    private Integer noCache;

    /**
     * 路由名称
     */
    @Length(message = "路由名称不能超过30个字符", max = 30, groups = {Save.class, Update.class})
    private String routerName;

    /**
     * 组件路径
     */
    @Length(message = "组件路径长度不能超过100个字符", max = 100, groups = {Save.class, Update.class})
    private String url;

    /**
     * 权限
     */
    @Length(message = "权限长度不能超过50个字符", max = 50, groups = {Save.class, Update.class})
    private String permission;

    /**
     * 启禁用
     */
    @NotNull(message = "启禁用不能为空", groups = {Save.class, Update.class})
    private EnableStatus enabled;

    /**
     * 组件路径
     */
    @Length(message = "组件路径长度不能超过50个字符", max = 50, groups = {Save.class, Update.class})
    private String componentPath;

    /**
     * 激活菜单名称
     */
    @Length(message = "组件路径长度不能超过50个字符", max = 50, groups = {Save.class, Update.class})
    private String activeMenu;

    /**
     * 是否显示
     */
    @NotNull(message = "是否显示不能为空", groups = {Save.class, Update.class})
    private Integer display;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {Save.class, Update.class})
    private Integer sortNo;

    /**
     * 备注
     */
    @Length(message = "备注长度不能超过100个字符", max = 100, groups = {Save.class, Update.class})
    private String remark;

}
